f = open('D:/bill.txt','r',encoding='UTF-8')
g = open('D:/bill.txt.bak','w',encoding='UTF-8')
for line in f:
    a = list(line)
    if (a[-2]) == '式':
        for i in a:
            g.write(i)
f.close()
g.close()